﻿@model DAL.Customer
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>用户修改</title>
    <link href="~/lib/layui/css/layui.css" rel="stylesheet" />
    <script src="~/lib/layui/layui.js"></script>
    <script src="~/js/jquery.min.js"></script>
</head>
<body>
    <form class="layui-form" action="/Customer/Edit" method="post" id="Addfm">
        <input type="hidden" name="Id" value="@Model.Id" class="layui-input">
        <div class="layui-form-item">
            <label class="layui-form-label">真实姓名</label>
            <div class="layui-input-inline">
                <input type="text" name="CustomerName" required lay-verify="required" value="@Model.CustomerName" placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">昵称</label>
            <div class="layui-input-inline">
                <input type="text" name="CustomerNiCheng" required lay-verify="required" value="@Model.CustomerNiCheng" placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="password" name="CustomerPassWord" required lay-verify="required" value="@Model.CustomerPassWord" placeholder="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-inline">
                <input type="text" name="CustomerPhone" required lay-verify="required" value="@Model.CustomerPhone" placeholder="请输入手机号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-inline">            
                <input  type="radio" name="CustomerSex" class="layui-input" value="男" @(Model.CustomerSex=="男"?"checked":"")/>男
                <input  type="radio" name="CustomerSex"  class="layui-input" value="女" @(Model.CustomerSex=="女"?"checked":"")/>女
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline">
                <input type="text" name="CustomerEmail" value="@Model.CustomerEmail" placeholder="请输入描述" class="layui-input">
            </div>
        </div>
        @*<div class="layui-form-item">
            <label class="layui-form-label">登录时间</label>
            <div class="layui-input-inline">
                <input type="text" name="CustomerLoginTime" value="@Model.CustomerLoginTime" placeholder="请输入描述" class="layui-input">
            </div>
        </div>*@
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
    <script>
        layui.use(['form', 'layer', 'upload'], function () {
            $ = layui.jquery;
            var form = layui.form,
                layer = layui.layer;
            form.on('submit(formDemo)', function (data) {
                $.post("/Customer/Edit",$("#Addfm").serialize(),function (res) {
                    if (res.success) {
                        layer.msg("修改成功", function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                            window.parent.location.reload();
                        });
                    }
                    else {
                        layer.alert("修改失败" + res.message, { icon: 5 });
                    }
                }, "json");
                return false;//不在进行传统提交
            });

        });
    </script>
</body>
</html>
